package com.example.my_flea_street.Mapper;

import com.example.my_flea_street.bean.Login;
import com.example.my_flea_street.bean.User;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface LoginMapper {

    @Select("select * from login where phone=#{phone}")
    Login userIsExisted(@Param("phone") String username);

    @Insert("insert into login values(#{phone},#{password})")
    void register(@Param("phone") String phone,@Param("password") String password);

    @Delete("delete from login where phone=#{phone}")
    void unRegist(@Param("phone") String phone);

    @Update("update login set password=#{password} where phone=#{phone}")
    void editPassword(@Param("phone") String phone,@Param("password") String password);

    @Select("select * from user where name=#{name}")
    Login nameIsExited(@Param("name") String name);
}
